var page = page || {};

page.dom = page.dom || {};

//处理文本
page.dom.Text = function() {
	this.insert = function(where) {
		var text = document.createTextNode(this.url);
		where.appendChild(txt)
	}
}

//处理链接
page.dom.Link = function() {
	this.insert = function(where) {
		var link = document.createElement('a');
		link.href = this.url;
		link.appendChild(document.createTextNode(this.url))
		where.appendChild(link)
	}
}

//处理图片
page.dom.Image = function() {
	this.insert = function(where) {
		var im = document.createElement('img');
		img.src = this.url;
		where.appendChild(img)
	}
}

page.dom.factory = function(type){
	return new this[type];
}

var o = page.dom.factory('Link');

o.url = 'http://wwww.baidu.com'

o.insert(document.body)














